]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
cleanup: Use rest operator to handle overly long argument lists
authorFlorian Müllner <fmuellner@gnome.org>
Fri, 1 Feb 2019 13:36:37 +0000 (14:36 +0100)
committerFlorian Müllner <fmuellner@gnome.org>
Mon, 1 Jul 2019 21:44:10 +0000 (23:44 +0200)
The existing indentation is bonkers, but there's no good replacement
with that many arguments. So switch to using the rest operator and
array destructuring as an alternative.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/607

js/ui/components/telepathyClient.js
js/ui/tweener.js

index c316084a2a14c5ee9342ee55d5586d6a7028d21a..1292d9a00376ec99f3fcd3a532c8d6c32d6ff11a 100644 (file)
@@ -147,8 +147,8 @@ class TelepathyClient extends Tp.BaseClient {
             this._delegatedChannelsCb.bind(this));
     }
 
-    vfunc_observe_channels(account, conn, channels,
-                                     dispatchOp, requests, context) {
+    vfunc_observe_channels(...args) {
+        let [account, conn, channels, dispatchOp, requests, context] = args;
         let len = channels.length;
         for (let i = 0; i < len; i++) {
             let channel = channels[i];
@@ -180,8 +180,8 @@ class TelepathyClient extends Tp.BaseClient {
         });
     }
 
-    vfunc_handle_channels(account, conn, channels, requests,
-                                    user_action_time, context) {
+    vfunc_handle_channels(...args) {
+        let [account, conn, channels, requests, user_action_time, context] = args;
         this._handlingChannels(account, conn, channels, true);
         context.accept();
     }
@@ -220,8 +220,8 @@ class TelepathyClient extends Tp.BaseClient {
         }
     }
 
-    vfunc_add_dispatch_operation(account, conn, channels,
-                                           dispatchOp, context) {
+    vfunc_add_dispatch_operation(...args) {
+        let [account, conn, channels, dispatchOp, context] = args;
         let channel = channels[0];
         let chanType = channel.get_channel_type();
 
index 26f3aeb0e92e91dd43aeaedcfddb8ea54d7a7666..3656f8119f99987d3953134669d8d756e7c7cb52 100644 (file)
@@ -129,10 +129,8 @@ function resumeTweens(...args) {
 }
 
 
-function registerSpecialProperty(name, getFunction, setFunction,
-                                 parameters, preProcessFunction) {
-    Tweener.registerSpecialProperty(name, getFunction, setFunction,
-                                    parameters, preProcessFunction);
+function registerSpecialProperty(...args) {
+    Tweener.registerSpecialProperty(...args);
 }
 
 function registerSpecialPropertyModifier(name, modifyFunction, getFunction) {